<template>
    <div>
        <h1>{{ count }}</h1>
        <!-- <button @click="count++">加一</button> -->
        <button v-on:click="print" @click="count++">按钮</button>
        <p>----------------------------------</p>

        <h1 v-for="(item, index) in a" :key="index" @click="a1(item, index)">{{ item }}---{{ index }}</h1>


    </div>
</template>

<script setup>
import { ref } from 'vue';
const a1 = (item, index) => {
    alert(`${item}--被点击了--下标为--${index}`)
}

const a = ref(['⏳⏳⏳', 'lisi', 'wangwu'])

const count = ref(1)
const print = () => {
    console.log(`点击了${count.value}次`)
}
</script>

<style lang="scss" scoped></style>